/**
 * @Author: zkz
 * @Date: 2025/09/29 16:04
 * @Description: 用户文章接口
 */
import { request } from '../utils/request';

//获取频道列表
export function getChannelAPI() {
	return request('/channels', {
		method: 'GET'
	});
}
//提交文章表单数据
export function createArticleAPI(params) {
	return request('/mp/articles?draft=false', {
		method: 'POST',
		data: params
	});
}
//修改更新文章
export function updateArticleAPI(id, params) {
	return request(`/mp/articles/${id}?draft=false`, {
		method: 'PUT',
		data: params
	});
}

//获取文章列表
export function getArticleListAPI(params) {
	return request({
		url: '/mp/articles',
		method: 'GET',
		params
	});
}
// 删除文章
export function deleteArticleAPI(id) {
	return request({
		url: `/mp/articles/${id}`,
		method: 'DELETE'
	});
}
//获取文章详情
export function getArticleDetailAPI(id) {
	return request({
		url: `/mp/articles/${id}`,
		method: 'GET'
	});
}
